/*!
@header ManagedObjectExporter
 @abstract Use ManagedObjectsExporter to export managed objects. This class is only used internally.
 */

#import <Cocoa/Cocoa.h>

@interface MO2XMLManagedObjectExporter : NSObject {
	NSManagedObject *managedObject;
	NSDictionary *properties;
}

- (id)init;
- (id)initWithManagedObject:(NSManagedObject *)mo;
- (void)dealloc;
+ (id)managedObjectExporterWithManagedObject:(NSManagedObject *)mo;

	/*!
    @method managedObject    
	 @result Returns the managed object on which the ManagedObjectExporter instance is working.
	 */
- (NSManagedObject *)managedObject;

	/*!
    @method setManagedObject    
	 @param value A pointer to a NSManagedObject instance you want to export.
	 */
- (void)setManagedObject:(NSManagedObject *)value;

	/*!
    @method managedObjectAsDictionary
	 @abstract The keys of the dictionary are the attributes of the managed object and the values 
	 are the corresponding values of the managed object.
	 @result Returns the managed object on which the ManagedObjectExporter instance is working as a dictionary.
	 */
- (NSDictionary *)managedObjectAsDictionary;


- (NSDictionary *)properties;
- (void)setProperties:(NSDictionary *)value;

	/*!
    @method writeToFile   
	 @discussion Exports the managed object set with setManagedObject:(NSArray *) to the file at path.
	 @result Returns YES if everything went fine and NO if there were any errors.
	 */
- (BOOL)writeToFile:(NSString *)path atomically:(BOOL)flag;

@end

